|
|
|
|
|
|
|
A Visual Basic Application |
|
|
|
|
|
|
|
|
To create a Visual Basic application, youll need to learn to take small components and glue them together into a complete application. The most common components youll use are forms, controls, classes, and procedures (see Figure 1.1). |
|
|
|
|
|
|
|
|
Figure 1.1
Visual Basic application components. |
|
|
|
|
|
|
|
|
Forms are windows upon which you build your user interface, and controls are the building blocks of the user interface. Controls, also called ActiveX Controls, are interface tools, such as labels, text boxes, and command buttons, that you use to display information to the user, gather information from the user, and respond to user actions. Classes are templates from which you can create your own objects at runtime. These reusable class modules aid you in organizing your application into small components that can be built into a complete application. Procedures are small routines you write that are callable from anywhere in your application. These routines will perform a function for you that you write once but can call many times. |
|
|
|
|
|
|
|
|
A very important concept in any Windows programming language is events. An event is something that occurs in response to a user interaction with the keyboard or the mouse. Events are messages that the operating system sends to your application. You will write some code to respond to these events and learn more about these in Chapter 5, Events Happen. |
|
|
|
|
|
|
|
|
Hierarchy of Visual Basic Applications |
|
|
|
|
|
|
|
|
As you work with Visual Basic, youll quickly learn that theres a hierarchy to the components you work with. An application is made up of forms, modules, and classes. A form is made up of properties, procedures, events, and controls. Controls are also made up of properties and events. Heres an overview of the basic components that make up a Visual Basic project: |
|
|
|
|
|